package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.MerchantOrderMerchantRole;
import com.rockcent.mall.lib.domain.enumclass.OrderType;
import com.rockcent.mall.lib.domain.enumclass.OrderVerificationWay;
import com.rockcent.mall.lib.domain.enumclass.SettlementStatus;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Created by DK on 16/10/29.
 * 核销
 */
@Table(name = "merchant_order_verification")
@Entity
@DynamicUpdate
@DynamicInsert
public class MerchantOrderVerification extends IDEntityMall {
    /**
     * 平台订单号
     */
    @Column(columnDefinition = "varchar(100) comment '平台订单号'")
    private String mallOrderNum;
    /**
     * 商家订单号
     */
    @Column(columnDefinition = "varchar(100) comment '商家订单号'")
    private String merchantOrderNum;

    /**
     * 商家ID
     */
    @Column(columnDefinition = "bigint comment '商家ID'")
    private Long merchantId;

    /**
     * 平台ID
     */
    @Column(columnDefinition = "bigint comment '平台ID'")
    private Long mallId;

    /**
     * 客户ID
     */
    @Column(columnDefinition = "bigint comment '客户ID'")
    private Long customerId;

    /**
     * 核销员ID
     */
    @Column(columnDefinition = "bigint comment '核销员ID'")
    private Long verifierId;

    /**
     * 客户名称
     */
    @Column(columnDefinition = "varchar(30) comment '客户名称'")
    private String customerName;

    /**
     * 产品订单ID
     */
    @Column(columnDefinition = "bigint comment '产品订单ID'")
    private Long merchantOrderItemId;

    /**
     * 订单类型
     */
    @Column(columnDefinition = "varchar(30) comment '订单类型'")
    @Enumerated(EnumType.STRING)
    private OrderType orderType;

    /**
     * 核销类型
     */
    @Column(columnDefinition = "varchar(30) comment '核销类型'")
    @Enumerated(EnumType.STRING)
    private OrderVerificationWay verificationWay;
    /**
     * 核销状态
     */
    @Column(columnDefinition = "varchar(30) comment '核销状态'")
    @Enumerated(EnumType.STRING)
    private SettlementStatus settlementStatus;
    /**
     * 产品ID
     */
    @Column(columnDefinition = "bigint comment '产品ID'")
    private Long productId;
    /**
     * 兑换码
     */
    @Column(columnDefinition = "varchar(30) comment '兑换码'")
    private String verifyCode;
    /**
     * 核销门店ID
     */
    @Column(columnDefinition = "bigint comment '核销门店ID'")
    private Long merchantStoreId;
    /**
     * 核销员工名称
     */
    @Column(columnDefinition = "varchar(30) comment '核销员工名称'")
    private String verifyCustomerName;
    /**
     * 产品ID
     */
    @Column(columnDefinition = "varchar(100) comment '产品ID'")
    private String productName;
    /**
     * 核销金额
     */
    @Column(columnDefinition = "DECIMAL(30,10) comment '核销金额'")
    private BigDecimal verifyPrice;
    /**
     * 产品售价
     */
    @Column(columnDefinition = "DECIMAL(30,10) comment '产品售价'")
    private BigDecimal productSellPrice;
    /**
     * 产品logo
     */
    @Column(columnDefinition = "varchar(255) comment '产品logo'")
    private String productLogo;
    /**
     * 核销店面
     */
    @Column(columnDefinition = "varchar(100) comment '核销店面'")
    private String merchantStoreName;
    /**
     * '核销数量
     */
    @Column(columnDefinition = "bigint comment '核销数量'")
    private Long verifyCount = 0L;

    /**
     * 渠道ID
     */
    @Column(columnDefinition = "bigint comment '渠道ID'")
    private Long channelId;

    /**
     * 商家角色。当订单为分销订单时,用于区分供应商或者分销商 SELF("默认"),SUPPLIER("供应商"), DISTRIBUTOR("分销商")
     */
    @Column(columnDefinition = "varchar(30) comment '商家角色。当订单为分销订单时,用于区分供应商或者分销商 SELF(\"默认\"),SUPPLIER(\"供应商\"), DISTRIBUTOR(\"分销商\")'")
    @Enumerated(EnumType.STRING)
    private MerchantOrderMerchantRole merchantRole = MerchantOrderMerchantRole.SELF;

    public String getMallOrderNum() {
        return mallOrderNum;
    }

    public void setMallOrderNum(String mallOrderNum) {
        this.mallOrderNum = mallOrderNum;
    }

    public String getMerchantOrderNum() {
        return merchantOrderNum;
    }

    public Long getChannelId() {
        return channelId;
    }

    public void setChannelId(Long channelId) {
        this.channelId = channelId;
    }

    public void setMerchantOrderNum(String merchantOrderNum) {
        this.merchantOrderNum = merchantOrderNum;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public Long getVerifierId() {
        return verifierId;
    }

    public void setVerifierId(Long verifierId) {
        this.verifierId = verifierId;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public Long getMerchantOrderItemId() {
        return merchantOrderItemId;
    }

    public void setMerchantOrderItemId(Long merchantOrderItemId) {
        this.merchantOrderItemId = merchantOrderItemId;
    }

    public OrderType getOrderType() {
        return orderType;
    }

    public void setOrderType(OrderType orderType) {
        this.orderType = orderType;
    }

    public OrderVerificationWay getVerificationWay() {
        return verificationWay;
    }

    public void setVerificationWay(OrderVerificationWay verificationWay) {
        this.verificationWay = verificationWay;
    }

    public SettlementStatus getSettlementStatus() {
        return settlementStatus;
    }

    public void setSettlementStatus(SettlementStatus settlementStatus) {
        this.settlementStatus = settlementStatus;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getVerifyCode() {
        return verifyCode;
    }

    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    public Long getMerchantStoreId() {
        return merchantStoreId;
    }

    public void setMerchantStoreId(Long merchantStoreId) {
        this.merchantStoreId = merchantStoreId;
    }

    public String getVerifyCustomerName() {
        return verifyCustomerName;
    }

    public void setVerifyCustomerName(String verifyCustomerName) {
        this.verifyCustomerName = verifyCustomerName;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public BigDecimal getProductSellPrice() {
        return productSellPrice;
    }

    public void setProductSellPrice(BigDecimal productSellPrice) {
        this.productSellPrice = productSellPrice;
    }

    public String getProductLogo() {
        return productLogo;
    }

    public void setProductLogo(String productLogo) {
        this.productLogo = productLogo;
    }

    public String getMerchantStoreName() {
        return merchantStoreName;
    }

    public void setMerchantStoreName(String merchantStoreName) {
        this.merchantStoreName = merchantStoreName;
    }

    public Long getVerifyCount() {
        return verifyCount;
    }

    public void setVerifyCount(Long verifyCount) {
        this.verifyCount = verifyCount;
    }

    public BigDecimal getVerifyPrice() {
        return verifyPrice;
    }

    public void setVerifyPrice(BigDecimal verifyPrice) {
        this.verifyPrice = verifyPrice;
    }

    public MerchantOrderMerchantRole getMerchantRole() {
        return merchantRole;
    }

    public void setMerchantRole(MerchantOrderMerchantRole merchantRole) {
        this.merchantRole = merchantRole;
    }


    @Override
    public String toString() {
        return "MerchantOrderVerification{" +
                "id=" + id +
                ", dateCreated=" + dateCreated +
                ", mallOrderNum='" + mallOrderNum + '\'' +
                ", merchantOrderNum='" + merchantOrderNum + '\'' +
                ", lastUpdated=" + lastUpdated +
                ", merchantId=" + merchantId +
                ", isDelete=" + isDelete +
                ", mallId=" + mallId +
                ", version=" + version +
                ", customerId=" + customerId +
                ", verifierId=" + verifierId +
                ", customerName='" + customerName + '\'' +
                ", merchantOrderItemId=" + merchantOrderItemId +
                ", orderType=" + orderType +
                ", verificationWay=" + verificationWay +
                ", settlementStatus=" + settlementStatus +
                ", productId=" + productId +
                ", verifyCode='" + verifyCode + '\'' +
                ", merchantStoreId=" + merchantStoreId +
                ", verifyCustomerName='" + verifyCustomerName + '\'' +
                ", productName='" + productName + '\'' +
                ", verifyPrice=" + verifyPrice +
                ", productSellPrice=" + productSellPrice +
                ", productLogo='" + productLogo + '\'' +
                ", merchantStoreName='" + merchantStoreName + '\'' +
                ", verifyCount=" + verifyCount +
                ", channelId=" + channelId +
                ", merchantRole=" + merchantRole +
                '}';
    }
}
